﻿using Open.Domain.Repositories.Metadata;

namespace Open.Domain.Abstractions.Implements
{

    /// <summary>
    /// 仓储
    /// </summary>
    /// <typeparam name="TEntity">实体类型</typeparam>
    public abstract class BaseRepository<TEntity> : BaseRepository<TEntity, string>, IRepository<TEntity>
        where TEntity : class, IAggregateRoot<TEntity, string>
    {
        /// <summary>
        /// 初始化仓储
        /// </summary>
        /// <param name="unitOfWork">工作单元</param>
        protected BaseRepository(IUnitOfWork unitOfWork)
            : base(unitOfWork)
        {

        }
    }


    /// <summary>
    /// 仓储
    /// </summary>
    /// <typeparam name="TEntity">实体类型</typeparam>
    /// <typeparam name="TKey">实体标识类型</typeparam>
    public abstract class BaseRepository<TEntity, TKey> : StoreBase<TEntity, TKey>, IRepository<TEntity, TKey>
        where TEntity : class, IAggregateRoot<TEntity, TKey>
    {
        /// <summary>
        /// 初始化仓储
        /// </summary>
        /// <param name="unitOfWork">工作单元</param>
        protected BaseRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
        {

        }
    }
}

